{layout name="common/layout" /}

<div class="dislpayArrow hidden-xs"><a class="pngfix" href="javascript:void(0);" onClick="displaynavbar(this)"></a></div>
<style>
    .main_area{
        width:100%;
        height:100%;
        position: relative;
        bottom:0;
        overflow: auto;
    }
    body, th, td, button, input, select, textarea {
        font-family: "Microsoft Yahei","Hiragino Sans GB","Helvetica Neue",Helvetica,tahoma,arial,"WenQuanYi Micro Hei",Verdana,sans-serif,"\5B8B\4F53";
        font-size: 16px;
        color: #333;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
</style>
<div class="Hui-article-box">
    <div class="Hui-article" style="top:0px;">
        <h3 class="showlist_title">平台活动列表</h3>

    <div class="main_area">
        <div class="cl">
            <form action="{:url('activity/listPingTaiActivity')}" method="get">
                <div style="position: relative;float: left;height: 20px;">
                    <input type="text" name="keyword" value="{:input('param.keyword')}" class="input-text" style="width: 240px;position: relative;top:-45px;">
                    <input id="btn_sub" type="submit" class="btn" value="搜索" style="position: relative;top:-45px;">
                </div>
                <div id="DataTables_Table_0_wrapper" class="dataTables_wrapper no-footer" style="width: 140px;height: 20px;float: right;position: relative;top:-15px;">
                    <div class="dataTables_length" id="DataTables_Table_0_length">
                        <label>
                            显示
                            <select id="pagesize" onchange="$('#btn_sub').click()"  name="DataTables_Table_0_length" aria-controls="DataTables_Table_0" class="select">
                                <?php $pagesize = input('param.DataTables_Table_0_length'); ?>
                                <option value="10" {if($pagesize == 10)}selected="selected"{/if}>10</option>
                                <option value="25" {if($pagesize == 25)}selected="selected"{/if}>25</option>
                                <option value="50" {if($pagesize == 50)}selected="selected"{/if}>50</option>
                                <option value="100" {if($pagesize == 100)}selected="selected"{/if}>100</option>
                            </select>
                            条
                        </label>
                    </div>
                </div>
            </form>
        </div>
        <table id="tb" class="table table-border table-bg  table-bordered" style="margin-left: 20px;line-height: 30px;height: 30px;width:95%;position: relative;">
            <thead>
            <tr>
                <td>编号</td>
                <td>标题</td>
                <td>营销折扣</td>
                <td>活动持续时间</td>
                <td>报名类型</td>
                <!--<td>规则</td>-->
                <td>操作</td>
            </tr>
            </thead>
            <tbody>
            {foreach ($activity_list as $k => $v)}
            <tr>
                <td>{$k+1}</td>
                <td>{$v['act_name']}</td>
                <td><?php echo intval($v['market_rate']) == 0 ? '无' : $v['market_rate'].'%';?></td>
                <td><?php echo date("Y-m-d",$v['start_time']);?>至<?php echo date("Y-m-d",$v['end_time']);?></td>
                <td><?php echo intval($v['join_type']) == 1 ? '商品报名(商品至少报名'.$v['join_num'].'个)' : '店铺报名';?></td>
                <!--<td><a style="color:deepskyblue;" href="https://{$v['link_url']}" target="_blank">rule</a></td>-->
                <td>
                    <a style="color:deepskyblue;" href="{:url('activity/joindetail')}?id={$v['id']}&page={$page}">详情</a>
                    {if condition="$v['join_btn'] eq '1'"}<a style="color:deepskyblue;" href="javascript:return false;" onclick="joinactivity({$v['id']});">报名</a>{/if}
                </td>
            </tr>
            {/foreach}
            </tbody>
        </table>
        <div class="cl">
            {$activity_list->render()}
        </div>
    </div>


    </div>
</div>
<script>
    function joinactivity(id){
        window.location.href = "{:url('activity/joinActivity')}?id="+id+"&page={$page}";
    }
</script>